home *** CD-ROM | disk | FTP | other *** search
/ An Invitation to the Roland World of Music / Roland - An Invitation To The Roland World Of Music.bin / vb / cooltool / sysex / sysex.bas < prev    next >
BASIC Source File  |  1995-04-20  |  1KB  |  45 lines

  1. Option Explicit
  2.  
  3. Global Const MODAL = 1
  4.  
  5. Sub MIDIInOpen ()
  6.     Dim wRtn As Integer
  7.     
  8.     If FormSysex.MIDIInput1.State >= MIDISTATE_OPEN Then
  9.         ' Close midiin port
  10.         FormSysex.MIDIInput1.Action = MIDIIN_CLOSE
  11.  
  12.         'Turn off the MIDI Filtering
  13.         FormSysex.MIDIInput1.Filter(FILTER_F9) = False
  14.         FormSysex.MIDIInput1.Filter(FILTER_ACTIVE_SENSE) = False
  15.         FormSysex.MIDIInput1.Filter(FILTER_CLOCK) = False
  16.     End If
  17.  
  18.     
  19.     ' Get selected device id
  20.     FormSysex.MIDIInput1.DeviceID = MIDISetupForm.ComboMidiIn.ListIndex
  21.     
  22.     ' Open midi in
  23.     FormSysex.MIDIInput1.Action = MIDIIN_OPEN
  24.  
  25.     'Turn on some MIDI Filtering
  26.     FormSysex.MIDIInput1.Filter(FILTER_F9) = True
  27.     FormSysex.MIDIInput1.Filter(FILTER_ACTIVE_SENSE) = True
  28.     FormSysex.MIDIInput1.Filter(FILTER_CLOCK) = True
  29.  
  30. End Sub
  31.  
  32. Sub MIDIOutOpen ()
  33.  
  34.     If FormSysex.MIDIOutput1.State >= MIDISTATE_OPEN Or FormSysex.MIDIOutput1.DeviceID = -1 Then
  35.         ' Close
  36.         FormSysex.MIDIOutput1.Action = MIDIOUT_CLOSE
  37.     End If
  38.     
  39.     ' Open selected device
  40.     FormSysex.MIDIOutput1.DeviceID = MIDISetupForm.ComboMidiOut.ListIndex - 1
  41.     FormSysex.MIDIOutput1.Action = MIDIOUT_OPEN
  42.     
  43. End Sub
  44.  
  45.